<?
/*调用首页banner*/
include_once("base.php");

//$_banner_list=select_lines_all_items($table_prefix."banner_term","nid desc","1=1","");
////print_r2($_banner_list);
//$result=$_banner_list;
$ip=$_SERVER["REMOTE_ADDR"];
$nowdate=date("Y-m-d");
//$user=$this->customer->getId().'<br>';
$_place_term_nid=$_REQUEST['nid'];
//$_place_term_nid=26;
//查看今日是否已经访问
$str="select * from " . $table_prefix . "likes_access_log where ip = '".$ip."' and date like '%".$nowdate."%' and nid = '".$_place_term_nid."' ";
$query=mysql_query($str) or die ('update error!');
//print_r2($query);
while($row = mysql_fetch_array($query))
{
    $likes[]=$row;
}
//print_r2($likes);
$like_ip=$likes[0]['ip'];
$like_date=$likes['date'];
$like_nid=$likes[0]['nid'];
if($like_nid==$_place_term_nid and $like_ip ==$ip){
    echo out("success",1,'已点赞');
}
else{
    echo out("success",-1, '未点赞');
}
?>


